package com.aloudmeta.grpc.support;

import com.github.luben.zstd.ZstdOutputStream;
import io.grpc.Compressor;

import java.io.IOException;
import java.io.OutputStream;

public class ZstdCompressor implements Compressor {

    @Override
    public String getMessageEncoding() {
        return "zstd";
    }

    @Override
    public OutputStream compress(OutputStream os) throws IOException {
        return new ZstdOutputStream(os);
    }
}
